package gobelinmaker.client;

import com.sun.scenario.scenegraph.SGShape;
import java.awt.Color;
import java.awt.geom.Ellipse2D;

/**
 * Tű objektum alaposztálya.
 *
 * @author imruf84
 */
public class NeedleComponent extends DiscoveredHoleComponent {

    @Override
    protected SGShape createShape() {

        double sih = HoleComponent.INNER_SIZE / 2;
        SGShape s = new SGShape();
        s.setShape(new Ellipse2D.Double(-sih, -sih, HoleComponent.INNER_SIZE, HoleComponent.INNER_SIZE));
        s.setFillPaint(Color.BLACK);
        s.setAntialiasingHint(RenderingProperties.ANTIALIASING);

        return s;
    }

    /**
     * Pozíció megadása.
     *
     * @param x első koordináta
     * @param y második koordináta
     */
    public void setPosition(long x, long y) {
        this.getHoleData().motorPosition[0] = x;
        this.getHoleData().motorPosition[1] = y;

        this.setLocation(x, y);
    }

    @Override
    public String toString() {
        return "Tű";
    }

}
